﻿using System;
using System.Net;
using System.Threading.Tasks;

namespace Letter.Net;

public interface IHost<TTransportOptions, TFeatureOptions>
    where TTransportOptions : class, ITransportOptions, new()
    where TFeatureOptions : class, IFeatureOptions, new()
{
    string Id { get; }

    string Name { get; }

    EndPoint BindEndPoint { get; }
    
    void ConfigureChannelOptions(TTransportOptions channelOptions);
    
    void ConfigureFeatureOptions(TFeatureOptions featureOptions);
    
    void ConfigureConnection(Func<AConnection> func);
    
    void Build();
    
    Task BindAsync(EndPoint endPoint);

    Task ConnectAsync(EndPoint endPoint);

    Task StopAsync();
}